/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.plt.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import edu.upn.sigemfi.plt.be.TipoChequera;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "PLT_CHEQUERA")
@NamedQueries({@NamedQuery(name = "Chequera.findAll", query = "SELECT c FROM Chequera c"), @NamedQuery(name = "Chequera.findByIdChequera", query = "SELECT c FROM Chequera c WHERE c.idChequera = :idChequera"), @NamedQuery(name = "Chequera.findByTipo", query = "SELECT c FROM Chequera c WHERE c.tipo = :tipo"), @NamedQuery(name = "Chequera.findByCantidadHojas", query = "SELECT c FROM Chequera c WHERE c.cantidadHojas = :cantidadHojas"), @NamedQuery(name = "Chequera.findBySerie", query = "SELECT c FROM Chequera c WHERE c.serie = :serie")})
public class Chequera implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_CHEQUERA")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idChequera;
    @Enumerated(EnumType.STRING)
    @Column(name = "TIPO")
    private  TipoChequera tipo;
    @Column(name = "CANTIDAD_HOJAS")
    private Integer cantidadHojas;
    @Column(name = "SERIE")
    private String serie;
    @JoinColumn(name = "FID_PLT_CUENTA", referencedColumnName = "ID_CUENTA")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Cuenta fidPltCuenta;
    @JoinColumn(name = "FID_PLT_SOLICITUD_CHEQUERA", referencedColumnName = "ID_SOLICITUD_CHEQUERA")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private SolicitudChequera fidPltSolicitudChequera;

    public Chequera() {
    }

    public Chequera(Long idChequera) {
        this.idChequera = idChequera;
    }

    public Long getIdChequera() {
        return idChequera;
    }

    public void setIdChequera(Long idChequera) {
        this.idChequera = idChequera;
    }

    public TipoChequera getTipo() {
        return tipo;
    }

    public void setTipo(TipoChequera tipo) {
        this.tipo = tipo;
    }



    public Integer getCantidadHojas() {
        return cantidadHojas;
    }

    public void setCantidadHojas(Integer cantidadHojas) {
        this.cantidadHojas = cantidadHojas;
    }

    public String getSerie() {
        return serie;
    }

    public void setSerie(String serie) {
        this.serie = serie;
    }

    public Cuenta getFidPltCuenta() {
        return fidPltCuenta;
    }

    public void setFidPltCuenta(Cuenta fidPltCuenta) {
        this.fidPltCuenta = fidPltCuenta;
    }

    public SolicitudChequera getFidPltSolicitudChequera() {
        return fidPltSolicitudChequera;
    }

    public void setFidPltSolicitudChequera(SolicitudChequera fidPltSolicitudChequera) {
        this.fidPltSolicitudChequera = fidPltSolicitudChequera;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idChequera != null ? idChequera.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Chequera)) {
            return false;
        }
        Chequera other = (Chequera) object;
        if ((this.idChequera == null && other.idChequera != null) || (this.idChequera != null && !this.idChequera.equals(other.idChequera))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.plt.be.Chequera[idChequera=" + idChequera + "]";
    }

}
